package com.boot2551.mapper;

import com.boot2551.bean.Salgrade;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface SalgradeMapper {
    @Insert(value = "insert into  salgrade values(default,#{losal},#{hisal})")
    int insert(Salgrade s);
    @Select(value = "select * from salgrade")
//    @ResultMap(value = "con") 如果封装类与表中属性不一致，则参照xml中的resultmap设置
    List<Salgrade> all();
    @Delete(value = "delete from salgrade where grade=#{id}")
    int delete(int id);
    @Select(value = "select * from salgrade where grade=#{id}")
    Salgrade one(int id);
    @Update(value = "update salgrade set losal=#{losal},hisal=#{hisal} where grade=#{grade}")
    int update(Salgrade s);
}
